﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cinema.BL.Interfaces.DTOs;
using Cinema.BL.Interfaces.Managers;
using Cinema.Model.Interfaces;
using Cinema.Model.Entities;

namespace Cinema.BL.Managers
{
    public class ActorManager : IActorManager
    {
         private IUnitOfWork _unitOfWork;

        public ActorManager(IUnitOfWork unitOfWork)
        {
            _unitOfWork = unitOfWork;
        }

        public IEnumerable<ActorDTO> GetList()
        {
            return _unitOfWork.ActorRepository.Read()
               .Select(x => new ActorDTO()
               {
                   Id = x.Id,
                   Name = x.Name,
                   BirthDate = x.BirthDate,
               }).ToList();
        }
    }
}
